package dearchenpush.good.com.qianfanlive.myapp;

import android.app.Application;

import com.zhy.http.okhttp.OkHttpUtils;

import java.util.concurrent.TimeUnit;

import okhttp3.OkHttpClient;

/**
 * Created by Administrator on 2016/9/27.
 */
public class MyApp extends Application{


    private static MyApp app;
    private OkHttpClient mOkHttpClient;

    @Override
    public void onCreate() {
        super.onCreate();
        this.app = this;
        //                .addInterceptor(new LoggerInterceptor("TAG"))
//其他配置
        mOkHttpClient = new OkHttpClient.Builder()
//                .addInterceptor(new LoggerInterceptor("TAG"))
                .connectTimeout(10000L, TimeUnit.MILLISECONDS)
                .readTimeout(10000L, TimeUnit.MILLISECONDS)
                //其他配置
                .build();

        OkHttpUtils.initClient(mOkHttpClient);

    }

    public static MyApp getApp() {
        return app;
    }

    public OkHttpClient getOkHttpClient() {
        return mOkHttpClient;
    }
}
